package com.hxzy.boot.old.requestcontroller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author wzm
 * @create 2023-09-23 9:12
 * project_name:javaweb2308
 */
@RestController
public class RequestController03 {

    //3.获取数据参数
    //数组方式接收
/*    @RequestMapping("/request03")
    public String req03(String[] hobby){//名称与请求名称一致
        System.out.println(Arrays.toString(hobby));
        return "ok!!!";
    }*/


    //使用集合接收多个相同名字的参数 @RequestParam将采纳数与集合绑定
    @RequestMapping("/request03")
    public String req03(@RequestParam List<String> hobby){//名称与请求名称一致
        System.out.println(hobby);
        return "ok!!!";
    }

}
